import httpRequest from './http';

/**
 * 
 * @param {更新新闻} params 
 */
export const reqUpdateNews = params => httpRequest.post('/news/update',params);
export const reqUpdateCategory = params => httpRequest.post('/news/updateCategory',params);
export const reqDeleteNews = params => httpRequest.post('/news/delete',params);
export const reqKeywordMatch = params => httpRequest.post('/keyword/create',params);
//statistics 新闻统计
export const reqStatisticsNews = params => httpRequest.get('/news/statistics',params);
export const reqIgnoreNews = params => httpRequest.post('/news/ignore',params);

// 专家相关 
export const reqExpertList = params => httpRequest.get('/expert/list',params);
export const reqExpertDetail = params => httpRequest.get('/expert/detail',params);
export const reqUpdateExpert = params => httpRequest.post('/expert/update',params);

//项目
export const reqProjectList = params => httpRequest.get('/project/list',params);
export const reqProjectDetail = params => httpRequest.get('/project/detail',params);
export const reqUpdateProject = params => httpRequest.post('/project/update',params);


/**
 * @desc 登录
 * @param params
 * @returns {Promise<unknown>}
 */
export const loginApi = (params) => httpRequest.post('/admin/login', params);
/**
 * @desc 用户列表
 * @param params
 * @returns {*}
 */
export const reqUsersList = (params) => httpRequest.get('/users/list', params);
/**
 * @desc 禁用用户
 * @param params
 * @returns {*}
 */
export const reqForbidUser = (params) => httpRequest.post('/user/banne', params);
/**
 * @desc 禁用用户
 * @param params
 * @returns {*}
 */
export const reqHidden = (params) => httpRequest.post(`/talkingTip/hidden/${params.id}`);
/**
 * @desc 用户详情
 * @param params
 * @returns {*}
 */
export const reqUserDetail = (params) => httpRequest.get('/user/getDetailsInfoById', params);
/**
 * @desc 举报列表
 * @param params
 * @returns {*}
 */
export const reqReportList = (params) => httpRequest.get('/user/reportList', params);
/**
 * @desc 用户详情
 * @param params
 * @returns {*}
 */
export const reqUserRefuse = (params) => httpRequest.post('/user/handleAuthUser', params);
/**
 * @desc 用户动态列表
 * @param params
 * @returns {*}
 */
export const reqUserMoment = (params) => httpRequest.get('/talkingTip/getTalkingTipsById', params);
/**
 * @desc 商品列表
 * @param params
 * @returns {*}
 */
export const reqProductsList = (params) => httpRequest.get('/product/list', params);
/**
 * @desc 店铺列表
 * @param params
 * @returns {Promise<unknown>}
 */
export const reqShopList = (params) => httpRequest.get('/shop/list', params);
export const reqNewsList = (params) => httpRequest.get('/news/list', params);

/**
 * @desc 获取经纬度地址
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqPoiResearch = (params) => httpRequest.get('/poi/search', params);

/**
 * @desc 创建商铺
 * @param params
 * @returns {*}
 */
export const reqCreateShop = (params) => httpRequest.post('/admin/addShop', params);

/**
 * @desc 创建商品
 * @param params
 * @returns {*}
 */
export const reqCreateProduct = (params) => httpRequest.post('/admin/addProduct', params);
/**
 * @desc 订单列表
 * @param params
 * @returns {*}
 */
export const reqOrderList = (params) => httpRequest.get('/admin/orders', params);
/**
 * @desc 申请列表
 * @param params
 * @returns {*}
 */
export const reqApplyList = (params) => httpRequest.get('/refund/list', params);
/**
 * @desc 同意退款
 * @param params
 * @returns {*}
 */
export const reqRefund = (params) => httpRequest.post('/refund/wxRefund', params);
/**
 * @desc 拒绝退款
 * @param params
 * @returns {*}
 */
export const reqRefundReject = (params) => httpRequest.post('/refund/reject', params);
/**
 * @desc 删除商品
 * @param params
 * @returns {Promise<unknown>}
 */
export const reqDeleteProduct = (params) => httpRequest.delete('/product/delete', params);
/**
 * @desc 商品详情
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDetailProduct = (params) => httpRequest.get('/product/detail', params);

export const reqNewsDetail = (params) => httpRequest.get('/news/detail', params);


/**
 * @desc 修改商品
 * @param params
 * @returns {*}
 */
export const reqUpdateProduct = (params) => httpRequest.post('/admin/updateProduct', params);

/**
 * @desc 店铺详情
 * @param params
 * @returns {*}
 */
export const reqDetailShop = (params) => httpRequest.get('/shop/detail', params);
/**
 * @desc 编辑店铺
 * @param params
 * @returns {*}
 */
export const reqUpdateShop = (params) => httpRequest.post('/admin/updateShop', params);

/**
 * @desc 商铺分类列表
 * @param params
 * @returns {*}
 */
export const reqGetPcategory = (params) => httpRequest.get('/pcategory/list', params);

/**
 * @desc 创建商铺分类
 * @param params
 * @returns {*}
 */
export const reqCreatePcategory = (params) => httpRequest.post('/pcategory/create', params);
/**
 * @desc 修改商铺分类
 * @param params
 * @returns {*}
 */
export const reqUpdatePcategory = (params) => httpRequest.post('/pcategory/update', params);
/**
 * @desc 删除商铺分类
 * @param params
 * @returns {*}
 */
export const reqDeletePcategory = (params) => httpRequest.delete('/pcategory/delete', params);
/**
 * @desc 商铺分类详情
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqPcategoryDetail = (params) => httpRequest.get('/pcategory/detail', params);


/**
 * @desc 入口分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqEntryList = (params) => httpRequest.get('/entry/list', params);

/**
 * @desc 新增入口分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqCreateEntry = (params) => httpRequest.post('/entry/create', params);
/**
 * @desc 修改入口分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqUpdateEntry = (params) => httpRequest.post('/entry/update', params);
/**
 * @desc 删除入口分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDeleteEntry = (params) => httpRequest.delete('/entry/delete', params);
/**
 * @desc 入口分类详情
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDetailEntry = (params) => httpRequest.get('/entry/detail', params);

/**
 * @desc 商品分类列表
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqShopCategoryList = (params) => httpRequest.get('/shopCategory/list', params);
/**
 * @desc 新建商品分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqCreateShopCategory = (params) => httpRequest.post('/shopCategory/create', params);
/**
 * @desc 修改商品分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqUpdateShopCategory = (params) => httpRequest.post('/shopCategory/update', params);
/**
 * @desc 删除商品分类
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDeleteShopCategory = (params) => httpRequest.delete('/shopCategory/delete', params);
/**
 * @desc 商品分类详情
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export const reqDetailShopCategory = (params) => httpRequest.get('/shopCategory/detail', params);
